package com.colabo.j2ee.web.oaf.orgnization.model;

import com.colabo.j2ee.web.core.vo.RecordObject;

public class SCUnitProfileVO extends RecordObject implements Comparable {
	private static final long serialVersionUID = -2329944501596017572L;
	public static final String KIND_ORG = "ORG";
	public static final String KIND_DEPT = "DEPT";
	public static final String KIND_DEFAULT = KIND_ORG;
	public static final String STATUS_INVALIDATE = "0";
	public static final String STATUS_VALIDATE = "1";
	public static final String STATUS_DEFAULT = STATUS_VALIDATE;

	private String unitName;
	private SCUnitProfileVO supervisionUnit;
	private SCUnitProfileVO fatherUnit;
	private String unitLevel;
	private String unitType;
	private String locationCode;
	private String bizType;;
	private String publicEmail;
	private String status;
	private String remark;
	private String unitCode;
	private String isSyn;
	private String treePath;
	private String treeLevel;
	private Integer indexNo;
	private String address;
	private String telephone;

	
	public Integer getIndexNo() {
		return indexNo;
	}

	public void setIndexNo(Integer indexNo) {
		this.indexNo = indexNo;
	}

	public String getIsSyn() {
		return isSyn;
	}

	public void setIsSyn(String isSyn) {
		this.isSyn = isSyn;
	}

	public String getUnitName() {
		return unitName;
	}

	public void setUnitName(String unitName) {
		this.unitName = unitName;
	}

	public String getUnitLevel() {
		return unitLevel;
	}

	public void setUnitLevel(String unitLevel) {
		this.unitLevel = unitLevel;
	}

	public String getBizType() {
		return bizType;
	}

	public void setBizType(String bizType) {
		this.bizType = bizType;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getUnitCode() {
		return unitCode;
	}

	public void setUnitCode(String unitCode) {
		this.unitCode = unitCode;
	}

	public String getTreePath() {
		return treePath;
	}

	public void setTreePath(String treePath) {
		this.treePath = treePath;
	}

	public String getTreeLevel() {
		return treeLevel;
	}

	public void setTreeLevel(String treeLevel) {
		this.treeLevel = treeLevel;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
	
	public SCUnitProfileVO getSupervisionUnit() {
		return supervisionUnit;
	}

	public void setSupervisionUnit(SCUnitProfileVO supervisionUnit) {
		this.supervisionUnit = supervisionUnit;
	}

	public SCUnitProfileVO getFatherUnit() {
		return fatherUnit;
	}

	public void setFatherUnit(SCUnitProfileVO fatherUnit) {
		this.fatherUnit = fatherUnit;
	}

	public String getUnitType() {
		return unitType;
	}

	public void setUnitType(String unitType) {
		this.unitType = unitType;
	}

	public String getLocationCode() {
		return locationCode;
	}

	public void setLocationCode(String locationCode) {
		this.locationCode = locationCode;
	}

	public String getPublicEmail() {
		return publicEmail;
	}

	public void setPublicEmail(String publicEmail) {
		this.publicEmail = publicEmail;
	}

	public int compareTo(Object obj) {

		SCUnitProfileVO test = (SCUnitProfileVO) obj;
		int t1;
		if (getTreePath() == null || getTreePath().trim().length() == 0) {
			t1 = 0;
		} else {
			t1 = getTreePath().split(",").length;
		}
		int t2;
		if (test.getTreePath() == null
				|| test.getTreePath().trim().length() == 0) {
			t2 = 0;
		} else {
			t2 = test.getTreePath().split(",").length;
		}

		// 返回负数表示o1小于o2，返回0表示o1和o2相等，返回正数表示o1大于o2
		return t1 - t2;
	}
}
